﻿#include <iostream>

#include "mdaclieapi.hpp"

int main()
{
	try
	{
		info("start");

		mdaclient client("tcp://localhost:5555");

		int count;
		for (count = 0; count < 10000; ++count)
		{
			zframe frame;
			frame.push_back("Hello world");
			client.send("echo", frame);
		}

		for (count = 0; count < 10000; ++count)
		{
			zframe frame = client.recv();
			if (frame.is_empty())
			{
				break;
			}
		}

		info("{} replies received", count);
	}
	catch (zmq::error_t& e)
	{
		info(e.what());
	}

	int a;
	std::cin >> a;
}